<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
	<th:block th:include="include :: header('新增设备库房信息')" />
	<th:block th:include="include :: select2-css" />
</head>
<body>
    <div class="main-content">
        <form id="form-user-add" class="form-horizontal">
            <h4 class="form-header h4">设备库房信息</h4>
            <div class="row">
            	<div class="col-sm-6">
                    <div class="form-group">
                        <label class="col-sm-4 control-label is-required">货位id：</label>
                        <div class="col-sm-8">
                            <input name="cargo_space_id" placeholder="请输入货位id" class="form-control" type="text" maxlength="30" required>
                        </div>
                    </div>
                </div>
                <div class="col-sm-6">
                    <div class="form-group">
                        <label class="col-sm-4 control-label is-required">仓库id：</label>
                        <div class="col-sm-8">
                            	<input name="warehouse_id" id="warehouse_id" type="text" placeholder="请选择归属部门" class="form-control" required>
                        </div>
                    </div>
                </div>
            </div><div class="row">
            	<div class="col-sm-6">
                    <div class="form-group">
                        <label class="col-sm-4 control-label ">巷道id：</label>
                        <div class="col-sm-8">
                            <input name="roadway_id" placeholder="请输巷道区id" class="form-control" type="text" maxlength="30" >
                        </div>
                    </div>
                </div>
                <div class="col-sm-6">
                    <div class="form-group">
                        <label class="col-sm-4 control-label">货区id：</label>
                        <div class="col-sm-8">
                            	<input name="cargo_area_id" id="cargo_area_id" type="text" placeholder="请选择归属部门" class="form-control">
                        </div>
                    </div>
                </div>
            </div><div class="row">
            	<div class="col-sm-6">
                    <div class="form-group">
                        <label class="col-sm-4 control-label ">货位类型：</label>
                        <div class="col-sm-8">
                            <input name="the_type" placeholder="请输入货位类型" class="form-control" type="text" maxlength="30" >
                        </div>
                    </div>
                </div>
                <div class="col-sm-6">
                    <div class="form-group">
                        <label class="col-sm-4 control-label">货位类型名称：</label>
                        <div class="col-sm-8">
                            	<input name="the_type_name" id="the_type_name" type="text" placeholder="请输入货位类型名称" class="form-control">
                        </div>
                    </div>
                </div>
            </div><div class="row">
            	<div class="col-sm-6">
                    <div class="form-group">
                        <label class="col-sm-4 control-label is-required">货位名称：</label>
                        <div class="col-sm-8">
                            <input name="cargo_space_name" placeholder="请输入货位名称" class="form-control" type="text" maxlength="30" required>
                        </div>
                    </div>
                </div>
                <div class="col-sm-6">
                    <div class="form-group">
                        <label class="col-sm-4 control-label ">托盘条码：</label>
                        <div class="col-sm-8">
                            <input name="tray_code" placeholder="请输入托盘条码" class="form-control" type="text" maxlength="30" >
                        </div>
                    </div>
                </div>

            </div><div class="row">
            <div class="col-sm-6">
                <div class="form-group">
                    <label class="col-sm-4 control-label is-required">排：</label>
                    <div class="col-sm-8">
                        <input name="the_platoon" id="the_platoon" type="text" placeholder="请选择归属部门" class="form-control"required>
                    </div>
                </div>
            </div>
            	<div class="col-sm-6">
                    <div class="form-group">
                        <label class="col-sm-4 control-label is-required">列：</label>
                        <div class="col-sm-8">
                            <input name="the_column" placeholder="请选择列" class="form-control" type="text" maxlength="30" required>
                        </div>
                    </div>
                </div>

            </div><div class="row">
            <div class="col-sm-6">
                <div class="form-group">
                    <label class="col-sm-4 control-label is-required">层：</label>
                    <div class="col-sm-8">
                        <input name="the_floor" id="the_floor" type="text" placeholder="请选择层" class="form-control"required>
                    </div>
                </div>
            </div>
            	<div class="col-sm-6">
                    <div class="form-group">
                        <label class="col-sm-4 control-label ">货位高度：</label>
                        <div class="col-sm-8">
                            <input name="cargo_hight" placeholder="请输入货位高度" class="form-control" type="text" maxlength="30" >
                        </div>
                    </div>
                </div>

            </div>
            <div class="row">
                <div class="col-sm-6">
                    <div class="form-group">
                        <label class="col-sm-4 control-label">是否双伸：</label>
                        <div class="col-sm-8">
                            <div class="input-group">
                                <select id="iss_double" name="iss_double" class="form-control" type="text">
                                    <option value="0">是</option>
                                    <option value="1">否</option>
                                </select>
                            </div>
                        </div>
                    </div>
                </div>
            	<div class="col-sm-6">
                    <div class="form-group">
                        <label class="col-sm-4 control-label ">双货位分组编码：</label>
                        <div class="col-sm-8">
                            <input name="group_coding_no" placeholder="请输入双货位分组编码" class="form-control" type="text" maxlength="30" >
                        </div>
                    </div>
                </div>

            </div>
            <div class="row">
                <div class="col-sm-6">
                    <div class="form-group">
                        <label class="col-sm-4 control-label">双货位分组编码：</label>
                        <div class="col-sm-8">
                            <input name="group_coding" id="group_coding" type="text" placeholder="请选择双货位分组编码" class="form-control">
                        </div>
                    </div>
                </div>
            	<div class="col-sm-6">
                    <div class="form-group">
                        <label class="col-sm-4 control-label ">双货位标识：</label>
                        <div class="col-sm-8">
                            <input name="cargo_space_logo" placeholder="请输入双货位标识" class="form-control" type="text" maxlength="30" >
                        </div>
                    </div>
                </div>

            </div>
            <div class="row">
                <div class="col-sm-6">
                    <div class="form-group">
                        <label class="col-sm-4 control-label">本仓库区域：</label>
                        <div class="col-sm-8">
                            <select name="this_cargo_area" class="form-control m-b" >
                                <option value="A">A</option>
                                <option value="B">B</option>
                            </select>
                        </div>
                    </div>
                </div>
                <div class="col-sm-6">
                    <div class="form-group">
                        <label class="col-sm-4 control-label">货位状态：</label>
                        <div class="col-sm-8">
                            <select name="status" class="form-control m-b" >
				                <option value="1">空货位</option>
				                <option value="2">满货位</option>
				            </select>
                        </div>
                    </div>
                </div>

            </div>
            <div class="row">
            <div class="col-sm-6">
                <div class="form-group">
                    <label class="col-sm-4 control-label is-required">是否锁定：</label>
                    <div class="col-sm-8">
                        <label class="toggle-switch switch-solid">
                            <input type="checkbox" id="locked" checked required>
                            <span></span>
                        </label>
                    </div>
                </div>
            </div>
            </div>
        </form>
    </div>
      
    <div class="row">
        <div class="col-sm-offset-5 col-sm-10">
            <button type="button" class="btn btn-sm btn-primary" onclick="submitHandler()"><i class="fa fa-check"></i>保 存</button>&nbsp;
            <button type="button" class="btn btn-sm btn-danger" onclick="closeItem()"><i class="fa fa-reply-all"></i>关 闭 </button>
        </div>
    </div>
	<th:block th:include="include :: footer" />
	<th:block th:include="include :: select2-js" />
	<script>
	    var prefix =ctx + "device/basCargoSpace";

        
        function submitHandler() {
	        if ($.validate.form()) {
	        	var data = $("#form-user-add").serializeArray();
	        	var locked = $("input[id='locked']").is(':checked') == true ? "Y" : "N";
	        	var status = $.form.selectCheckeds("status");
	        	data.push({"name": "locked", "value": locked});
	        	data.push({"name": "status", "value": status});
	        	$.operate.saveTab(prefix + "/add", data);
	        }
	    }
		$(function() {
            $('#post').select2({
                placeholder: "请选择岗位",
                allowClear: true
            });
        })
    </script>
</body>
</html>